<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        function Char(weight, color, brand) {
            this.weight = weight;
            this.color = color;
            this.brand = brand;
            this.zairen = function (zai) {
                console.log(zai);
            }
            this.lahuo = function (la) {
                console.log(la);
            }
            this.gengtian = function (tian) {
                console.log(tian);
            }
        }
        var che = new Char('18k', 'pink', '比亚迪');
        
        for (var k in che) {
            console.log(che[k]);
        }
        che.zairen('载人');
        che.lahuo('拉货');
        che.gengtian('耕田');
    </script>
</head>

<body>

</body>

</html>